<!DOCTYPE html>
<html>
<head>
	<script type="text/javascript">
	  safari.application.addEventListener("command", toggleBar, false);
      safari.application.addEventListener("validate", validateToggle, false);
	  
	  const bars = safari.application.bars;
	  
	  function toggleBar(event) {
	    if (event.command === "toggle-bar") {
		  var barState = safari.extension.bars[i].visible;
		  if (barState = true) {
		    for (var i =0; i < bars.length; i++) {
			  var bar = bars[i];
			  //bar.hide();
			  bar.revealText();
			}
		  }
		  else {
		    for (var i =0; i < bars.length; i++) {
			  var bar = bars[i];
			  bar.show();
			}
		  }
		}
	  }
	  
	  function validateToggle(event) {
	    //nothing to validate for now
	  }
	</script>
</head>
<body>


</body>
</html>